<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%>
<% global_forwarding_rule = grab_attributes(pwd)['global_forwarding_rule'] -%>
describe google_compute_global_forwarding_rule(project: <%= doc_generation ? "#{gcp_project_id}" : "gcp_project_id" -%>, name: <%= doc_generation ? "'#{global_forwarding_rule['name']}'" : "global_forwarding_rule['name']" -%>) do
  it { should exist }
  its('port_range') { should eq <%= doc_generation ? "'#{global_forwarding_rule['port_range']}'" : "global_forwarding_rule['port_range']" -%> }
  its('target') { should  match /\/<%= "#{grab_attributes(pwd)['http_proxy']['name']}" -%>$/ }
end

describe google_compute_global_forwarding_rule(project: <%= doc_generation ? "#{gcp_project_id}" : "gcp_project_id" -%>, name: 'nonexistent') do
  it { should_not exist }
end